package Tests;

import static org.junit.Assert.*;

import org.junit.Test;

import Accounts.CheckingAccount;
import Accounts.DebitCard;

public class DebitCardTest {
	
	public DebitCardTest()
	{
		testDebitCard();
		testDebitCardCheckingAccount();
		testPay();
	}

	@Test
	public void testDebitCard() {
		DebitCard defaultCard = new DebitCard("Test","test2", "test3", "test4", "test5");
		assertNotNull("The card object is null", defaultCard);
	}

	@Test
	public void testDebitCardCheckingAccount() {
		CheckingAccount dummyAccount = new CheckingAccount("Test","test2", "test3", "test4", "test5", 234);
		
		DebitCard accountCard = new DebitCard("Test","test2", "test3", "test4", "test5",2000, dummyAccount);
		assertNotNull("The card object is null",accountCard);
	}

	@Test
	public void testPay() {
		CheckingAccount dummyAccount = new CheckingAccount("Test","test2", "test3", "test4", "test5", 250);
		DebitCard accountCard = new DebitCard("Test","test2", "test3", "test4", "test5",2000, dummyAccount);
		dummyAccount.setBalance(2000);
		assertFalse("Not false",accountCard.pay(250));
		assertTrue("not True", accountCard.pay(2500));
	}

}
